#pragma once

#include <QSocketNotifier>
#include <QNetworkReply>

#include <memory>


struct ISocketReadInterceptor
{
	ISocketReadInterceptor()
		: isInterceptorSet(false)
	{
	}

	virtual ~ISocketReadInterceptor()
	{
	}

	virtual bool intercept(QSocketNotifier* notifier, QEvent* event) = 0;

	bool isInterceptorSet;
};


bool handleSocketReadNotify(QObject* receiver, QEvent* event);

void subscribeSocketReadInterceptor(QNetworkRequest* request, const std::shared_ptr<ISocketReadInterceptor>& interceptor);

